import Cookies from 'js-cookie';

import { tokenKey } from '@/config/settings';

export function getToken() {
  const token = Cookies.get(tokenKey);
  if (typeof token === 'string') {
    return token;
  }
  return '';
}

export function setToken(token) {
  return Cookies.set(tokenKey, token);
}

export function removeToken() {
  return Cookies.remove(tokenKey);
}
